package ee.graphicscard.controller;

import javax.servlet.http.HttpServletRequest;
import ee.graphicscard.controller.forms.GraphicsCardForm;

public class GETPOSTFormRequestProcessor 
{
	public GraphicsCardForm getGraphicsCardFormWithUpdatedData(HttpServletRequest request)
	{
		GraphicsCardForm graphicsCardForm = new GraphicsCardForm();
		String graphicscard_id = request.getParameter("graphicscard_id");
		String product_name = request.getParameter("product_name");
		String cudacores = request.getParameter("cudacores");
		String overview = request.getParameter("overview");
		graphicsCardForm.setGraphicscard_id(graphicscard_id);
		graphicsCardForm.setProduct_name(product_name);
		graphicsCardForm.setCudacores(cudacores);
		graphicsCardForm.setOverview(overview);
		
		return graphicsCardForm;
	}
	
	public boolean hasGraphicsCardUpdateDataBeenInitialized(HttpServletRequest request)
	{
		if (request.getParameter("graphicsCardToSaveExists") != null)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
}
